<!DOCTYPE HTML>
<html>
<head>
<#include "common.html"/>
<style type="text/css">

.long{
    width: 210px;
}

.short{
    width: 110px!important;
}

input[name='param']{
    width: 100px;
}
</style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">

    <#include "header.html"/>
    <#include "menu.html"/>

    <script>
        var enum_Approach={};
        <#list approach as item>
        enum_Approach.${item}=${item.id};
        </#list>
        var enum_Supplier={};
        <#list supplier as item>
        enum_Supplier.${item}=${item.id};
        </#list>
        var enum_Challenge={};
        <#list challenge as item>
        enum_Challenge.${item}=${item.id};
        </#list>
        var enum_Encryption={};
        <#list encryption as item>
        enum_Encryption.${item}=${item.id};
        </#list>
        var dnsapiData=[];
        <#list dnsapi as item>
            dnsapiData.push({name:"${item}",value:"${item}"});
        </#list>

    </script>
    <div class="layui-body">


        <!-- 内容主体区域 -->
        <div style="padding: 15px">





            <fieldset class="layui-elem-field layui-field-title">
                <legend>${i18n.get("menu.cert")}</legend>
            </fieldset>

            <form action="${ctx}/admin/http" id="searchForm" method="post">
                <div class="layui-form">
                    <div class="layui-inline" style="display: none">
                        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="add">${i18n.get("add.cert")}</button>
                    </div>
                    <div class="layui-inline" style="display:none">
                        <button type="button" class="layui-btn layui-btn-sm" id="guide">${i18n.get("commonStr.edit")}</button>
                    </div>
                    <div class="layui-inline" style="display:none">
                        <button type="button" class="layui-btn layui-btn-sm">${i18n.get("commonStr.edit")}</button>
                    </div>
                    <div class="layui-inline" style="display:none">
                        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal">${i18n.get("commonStr.clear")}</button>
                    </div>
                </div>
            </form>

            <table class="layui-hide" id="demo" lay-filter="test"></table>


        </div>
    </div>
</div>




<div style="height: 500px; width: 300px; overflow: hidden;">
    <!-- 弹出框 -->
    <div class="layui-form" id="windowDiv" style="padding: 15px; display: none">
        <form id="addForm1" class="layui-form" lay-filter="test">
            <input type="hidden" name="u">

            <div class="layui-row">
                <div class="layui-col-md4"><div class="grid-demo">


                        <div class="layui-form-item" id="div_id">
                            <label class="layui-form-label">id</label>
                            <div class="layui-input-block">
                                <input type="text" name="id" class="layui-input" placeholder="可空">
                            </div>
                        </div>

                    </div></div>

                <div class="layui-col-md4"><div class="grid-demo">
                    &nbsp;
                </div></div>
            </div>


            <div class="layui-row">


                <div class="layui-col-md3"><div class="grid-demo">
                    <div class="layui-form-item" id="div_encryption">
                        <label class="layui-form-label">encryption</label>
                        <div class="layui-input-block">
                            <select name="encryption" lay-filter="encryption">
                                <#list encryption as item><option value="${item.id}">${item.getName()}</option></#list>
                            </select>
                        </div>
                    </div>
                </div></div>

                <div class="layui-col-md4"><div class="grid-demo">
                    &nbsp;
                </div></div>


            </div>



            <div class="layui-row">
                <div class="layui-col-md4"><div class="grid-demo">

                        <div class="layui-form-item" id="div_approach">
                            <label class="layui-form-label">approach</label>
                            <div class="layui-input-block">
                                <select name="approach" lay-filter="approach">
                                    <#list approach as item><option value="${item.id}">${item.getName()}</option></#list>
                                </select>
                            </div>
                        </div>

                    </div></div>
                    <div class="layui-col-md4"><div class="grid-demo">

                        <div class="layui-form-item" id="div_CA">
                            <label class="layui-form-label">CA</label>
                            <div class="layui-input-block">
                                <select name="caId" lay-filter="demo-select-filter" id="CASelect">
                                    <option value="" selected></option>
                                </select>
                                <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" id="newCA"><i class="layui-icon layui-icon-addition"></i></button>
                                <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" id="reloadCA"><i class="layui-icon layui-icon-refresh"></i></button>
                                <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" id="listCA"><i class="layui-icon layui-icon-edit"></i></button>
                            </div>
                        </div>
                    </div></div>
                        <div class="layui-col-md4"><div class="grid-demo">

                        <div class="layui-form-item" id="div_supplier">
                            <label class="layui-form-label">supplier</label>
                            <div class="layui-input-block">
                                <select name="supplier" lay-filter="supplier">
                                    <#list supplier as item><option value="${item.id}">${item.getName()}</option></#list>
                                </select>
                            </div>
                        </div>


                    </div></div>
            </div>


            <div class="layui-row">
                <div class="layui-col-md4"><div class="grid-demo">
                    <div class="layui-form-item" id="div_domain">
                        <label class="layui-form-label">domain</label>
                        <div class="layui-input-block">
                            <input type="text" name="domain" class="layui-input" placeholder="不可空">
                        </div>
                    </div>
                </div></div>

                <div class="layui-col-md4"><div class="grid-demo">
                    <div class="layui-form-item" id="div_subject">
                        <label class="layui-form-label">subject</label>
                        <div class="layui-input-block">
                            <input type="text" name="subject" class="layui-input" placeholder="可空">
                        </div>
                    </div>
                </div></div>
            </div>



            <div class="layui-row">

                <div class="layui-col-md4"><div class="grid-demo">

                <div class="layui-form-item" id="div_challenge">
                    <label class="layui-form-label">challenge</label>
                    <div class="layui-input-block">
                        <select name="challenge" lay-filter="challenge">
                            <#list challenge as item><option value="${item.id}">${item.getName()}</option></#list>
                        </select>
                    </div>
                </div>

                </div></div>


                <div class="layui-col-md4"><div class="grid-demo">

                    <div class="layui-form-item" id="div_dnsapi">
                        <label class="layui-form-label">dnsapi</label>
                        <div class="layui-input-block">
<!--                            <select name="dnsapi" lay-filter="dnsapi" lay-search="">-->
<!--                                <#list dnsapi as item><option value="${item}">${item}</option></#list>-->
<!--                            </select>-->

                            <div id="demo3" class="xm-select-demo"></div>

                            <script>

</script>

                        </div>
                    </div>

                </div></div>


            </div>


            <div class="layui-row">
                <div class="layui-col-md4"><div class="grid-demo">
                    &nbsp;
                </div></div>

                <div class="layui-col-md4"><div class="grid-demo">
                    &nbsp;
                </div></div>
            </div>















            <div class="layui-row">
                <div class="layui-col-md8"><div class="grid-demo">
                    <div class="layui-form-item" id="div_aux">
                        <label class="layui-form-label">aux &nbsp;<a href="https://github.com/acmesh-official/acme.sh/wiki/dnsapi#how-to-use-dns-api" target="_blank"><i class="layui-icon layui-icon-question" style="font-size: 14px; color: #1E9FFF;"></i></a>
                        </label>
                        <div class="layui-input-block">
                            <textarea name="aux" placeholder="可空,当使用DNS-01作为Challenge时的环境变量" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div></div>

                <div class="layui-col-md2"><div class="grid-demo">
                    &nbsp;
                </div></div>
            </div>





            <div class="layui-row">
                <div class="layui-col-md3"><div class="grid-demo">
                    <div class="layui-form-item" id="div_renew">
                        <label class="layui-form-label">&nbsp;</label>
                        <div class="layui-input-block">
                        <input type="checkbox" name="renew" lay-text="自动renew证书" value="checked_value">
                        </div>
                    </div>
                </div></div>

                <div class="layui-col-md3"><div class="grid-demo">
                    <div class="layui-form-item" id="div_issue">
                        <div class="layui-input-block">
                            <input type="checkbox" name="issue" lay-text="马上申请" value="checked_value">
                        </div>
                    </div>
                    &nbsp;
                </div></div>
            </div>













                <div class="layui-form-item" style="margin-top:20px;margin-bottom:20px" id="div_certFile">
                    <label class="layui-form-label">cert</label>

                    <div class="layui-input-inline short">
                        <button type="button" class="layui-btn layui-btn-normal" id="upload-cert">upload</button>
                    </div>
                    <div class="layui-form-mid layui-word-aux"><span class="layui-inline layui-upload-choose" id="layui-upload-choose-cert"></span></div>

                </div>



                <div class="layui-form-item" style="margin-top:20px;margin-bottom:20px" id="div_keyFile">
                    <label class="layui-form-label">key</label>

                    <div class="layui-input-inline short">
                        <button type="button" class="layui-btn layui-btn-normal" id="upload-key">upload</button>
                    </div>
                    <div class="layui-form-mid layui-word-aux"><span class="layui-inline layui-upload-choose" id="layui-upload-choose-key"></span></div>

                </div>






            <div class="layui-form-item center">
                <button type="button" class="layui-btn layui-btn-normal" id="addOver">${i18n.get("commonStr.submit")}</button>
                <button type="button" class="layui-btn" onclick="layer.closeAll()">${i18n.get("commonStr.close")}</button>
            </div>




        </form>
    </div>

    <div class="layui-form" id="newDiv" style="padding: 15px; display: none">
        <form id="caForm" class="layui-form">
            <div class="layui-form-item" id="id">
                <label class="layui-form-label">id</label>
                <div class="layui-input-block">
                    <input type="text" name="id" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item" id="title">
                <label class="layui-form-label">title</label>
                <div class="layui-input-block">
                    <input type="text" name="title" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item" id="new subject">
                <label class="layui-form-label">subject</label>
                <div class="layui-input-block">
                    <input type="text" name="subject" class="layui-input">
                </div>
            </div>




        <div class="layui-form-item center">
            <button type="button" class="layui-btn layui-btn-normal" id="newCAOver">${i18n.get("commonStr.submit")}</button>
        </div>
        </form>
    </div>


    <div class="layui-form" id="viewDiv" style="padding: 15px; display: none">
        <form id="addForm4">
            <input type="hidden" name="u">


            <div class="layui-form-item" style="display: none">
                <label class="layui-form-label">id</label>
                <div class="layui-input-block">
                    <input type="text" name="id" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" id="div_content">
                <label class="layui-form-label">content</label>
                <div class="layui-input-block">
                    <pre id="editor1" class=".json-editor"></pre>
                </div>
            </div>





            <div class="layui-form-item center">
<!--                <button type="button" class="layui-btn layui-btn-normal" id="addOver4">${i18n.get("commonStr.submit")}</button>-->
                <button type="button" class="layui-btn" onclick="layer.closeAll()">${i18n.get("commonStr.close")}</button>
            </div>
        </form>
    </div>


            <div class="layui-form-item center">
                <button type="button" class="layui-btn layui-btn-normal" id="ID-upload-demo-action">${i18n.get("commonStr.submit")}
                    <i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop" id="loading" style="display: none"></i>
                </button>
                <button type="button" class="layui-btn" onclick="layer.closeAll()">${i18n.get("commonStr.close")}</button>
            </div>

        </form>
    </div>

</div>

<#include "script.html"/>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="add"><i class="layui-icon  layui-icon-add-1"></i></button>
        <button class="layui-btn layui-btn-sm" lay-event="deleteSelected"><i class="layui-icon  layui-icon-delete"></i></button>
        <button class="layui-btn layui-btn-sm" lay-event="getCheckData" style="display: none">获取选中行数据</button>
        <button class="layui-btn layui-btn-sm" lay-event="statusAll1" style="display: none">${i18n.get("commonStr.batchEnable")}</button>
        <button class="layui-btn layui-btn-sm" lay-event="statusAll0" style="display: none">${i18n.get("commonStr.batchDisable")}</button>
    </div>
</script>
<script src="${ctx}/lib/xm-select/xm-select.js?v=${jsrandom}" type="text/javascript"></script>
<script src="${ctx}/js/admin/cert/index.js?v=${jsrandom}" type="text/javascript"></script>
</body>
</html>